var Loader = function(){
    return Loader.fn.init();
}


Loader.fn = Loader.prototype = {
	// Init
   init:function(){},
	
   
   
   getAjax: function(url, async, responseType) {

       var _this = this;
       
       if(!async) async = true;
       
       if(!responseType) responseType = 'json'; 

       var def = $.Deferred();

       return $.ajax({
           url: url,
           type: 'get',
           dataType: responseType,
           cache: true,
           beforeSend: function(request) {
//               _this._beforeSendRequest(request);
//               if(!hideLoading) mx.core.showMainLoading();
           },
           complete: function() {
//               mx.core.hideMainLoading();
           },
           success: function(msg, textStatus, jqXHR) {
               def.resolve(msg);
           },
           statusCode: {
               401: function() {
                   //window.location.href = '/login';
               }
           },
           error: function(xhr, status, err) {
               if (xhr.status === 401)
                   //window.location.href = '/login';

               def.reject.apply(arguments);
           },
           async: async

       });

       return def;
   },
   
   
	
	 
};

var loader = new Loader();